<<<<<<< HEAD ||||||| merged common ancestors ======= >>>>>>> 371ff05b569a6264d9798b347807497f5edc6dbd Heatmaps

Heatmaps

Heatmaps for microbiome analysis

See Composition page for further microbiota composition heatmaps, as well as the phyloseq tutorial and Neatmaps. Moreover, the aheatmap function of the NMF package provides further high quality heatmap plotting capabilities with row and column annotation color bars, clustering trees and other useful features that are often missing from standard heatmap tools in R.

Load some example data:

Matrix heatmaps

Visualize the Z-transformed abundance matrix

<<<<<<< HEAD
# Plot the abundances heatmap
heat(melt(abundances(pseqz)), "Var1", "Var2", "value")

||||||| merged common ancestors
# Plot the abundances heatmap
heat(melt(abundances(pseqz)), "Var1", "Var2", "value")

=======

>>>>>>> 371ff05b569a6264d9798b347807497f5edc6dbd

Find visually appealing order for rows and columns with the Neatmap approach:

<<<<<<< HEAD
# Sort the matrix rows and cols directly
xo <- neat(abundances(pseqz), method = "NMDS", distance = "euclidean") 

# Heatmap visualization
heat(melt(xo), "Var1", "Var2", "value")

# or use a shortcut to sorting rows (or columns) if just the order was needed 
sorted.rows <- neatsort(abundances(pseqz), "rows", method = "NMDS", distance = "euclidean") 
||||||| merged common ancestors
# Sort the matrix rows and cols directly
xo <- neat(abundances(pseqz), method = "NMDS", distance = "euclidean") 

# Heatmap visualization
heat(melt(xo), "Var1", "Var2", "value")

# or use a shortcut to sorting rows (or columns) if just the order was needed 
sorted.rows <- neatsort(abundances(pseqz), "rows", method = "NMDS", distance = "euclidean") 
=======

>>>>>>> 371ff05b569a6264d9798b347807497f5edc6dbd

Cross-correlating data sets

Cross-correlate columns of two data sets from related to microbiome and blood serum lipids associations (PeerJ 1:e32).

The function returns correlations, raw p-values, and fdr estimates (not strictly proper as the comparisons are not independent). Keep only those elements that have at least only one significant correlation (n.signif):

X1 X2 Correlation p.adj
1648 Ruminococcus gnavus et rel. TG(54:5).2 0.7164958 0.0022842
384 Moraxellaceae PC(40:3e) -0.6941863 0.0029225
1829 Uncultured Bacteroidetes TG(56:2).1 -0.6987375 0.0029225
349 Lactobacillus plantarum et rel. PC(40:3) -0.6877976 0.0031520
1198 Ruminococcus gnavus et rel. TG(52:5) 0.6806216 0.0037518
264 Moraxellaceae PC(38:4).1 -0.6700504 0.0038414

Association heatmaps

<<<<<<< HEAD

Rearrange the data and plot the heatmap and mark significant correlations with stars to reproduce microbiota-lipidome heatmap from Lahti et al. PeerJ (2013) (the ordering of rows and columns may be different):

p <- heat(correlation.table, "X1", "X2", fill = "Correlation", star = "p.adj", p.adj.threshold = 0.05) 
print(p)

||||||| merged common ancestors

Rearrange the data and plot the heatmap and mark significant correlations with stars to reproduce microbiota-lipidome heatmap from Lahti et al. PeerJ (2013) (the ordering of rows and columns may be different):

p <- heat(correlation.table, "X1", "X2", fill = "Correlation", star = "p.adj", p.adj.threshold = 0.05) 
print(p)

=======

Rearrange the data and plot the heatmap and mark significant correlations with stars to reproduce microbiota-lipidome heatmap from Lahti et al. PeerJ (2013) (the ordering of rows and columns may be different):

>>>>>>> 371ff05b569a6264d9798b347807497f5edc6dbd
<<<<<<< HEAD

Leo Lahti, Sudarshan Shetty et al. 2018-11-19

||||||| merged common ancestors

Leo Lahti, Sudarshan Shetty et al. 2018-07-22

=======

Leo Lahti, Sudarshan Shetty et al. 2018-11-15

>>>>>>> 371ff05b569a6264d9798b347807497f5edc6dbd